import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Vant from 'vant'
import 'vant/lib/index.css'
import axios from 'axios'
import infiniteScroll from 'vue-infinite-scroll';
Vue.use(infiniteScroll);
Vue.use(Vant)
Vue.config.productionTip = false
axios.interceptors.request.use(
  config => {
    const token = localStorage.getItem('token');
    if (token) {
      config.headers.Authorization = `Bearer ${token}`; 
    }
    return config;
  },
  error => {
    return Promise.reject(error);
  }
);

new Vue({
  render: h => h(App),
  router,
}).$mount('#app')
